package com.waya.web.browser.webview;

import android.content.Context;
import android.webkit.JavascriptInterface;

import com.waya.web.browser.common.util.AndroidUtils;
import com.waya.web.browser.common.util.ApkUtil;

/**
 * Created by JesseHev on 2018/1/16.
 * describe: js调用native的声明
 */

public class AndroidContext {

    private Context mContext;

    public AndroidContext(Context context) {
        mContext = context;
    }

    @JavascriptInterface
    public String getValue(String key) {
        return AndroidUtils.getValue(mContext, key);
    }

    @JavascriptInterface
    public void startActivity(String pkgName, String activityName, String actions, String categorys,
                              String datas, String params) {
        ApkUtil.startApp(mContext, pkgName, activityName, actions, categorys, datas, params);
    }

}
